
function delete_id(){//通过delete方法请求后端，请求时携学生id

    $.ajax({
        url:'/user/delete_stu_id/'+$('#id').val(),
        type:'DELETE',
        success:function (data){//请求成功 则提示用户
          
            $("#alert").text(data.msg)
            $("#alert").addClass("alert-success")
            $('#alert').css('display', 'block');
             var i = 2
             var timer = setInterval(function (){//设置定时器，定时关闭提示
                    i--
                    if(i===0){
                        $('#alert').css('display', 'none');
                        clearTimeout(timer);
                        $('#id').val('')
                    }
             },1000)
        }
    })
}
function delete_name(){
    $.ajax({//通过delete方法请求后端，请求时携学生姓名
        url:'/user/delete_name/',
        type:'DELETE',
        data : { id : 123 },
        success:function (data){//请求成功 则提示用户
            $('.alert-primary').text(data['msg'])
            $('.alert-primary').addClass('active')
             var i = 2
             var timer = setInterval(function (){//设置定时器，定时关闭提示
                    i--
                    if(i===0){
                        $('.alert-primary').removeClass('active');
                        clearTimeout(timer);
                        $('#name').val('')
                    }
             },1000)
        }
    })
}